<?php
namespace Home\Model;
use Think\Model\RelationModel;
class BorrowModel extends RelationModel{
	protected $connection = 'CAIWU';
	protected $trueTableName = 'user_borrow';

	protected $_link = array(
        'repayment'=>array(   
            'mapping_type'      => self::HAS_MANY,
            'class_name'        => 'Repayment',       //关联类名
            'foreign_key'       => 'bid',        //外键
            'condition'         => 'is_success = 1',
            // 'mapping_fields'    => 'id,goods_id,spec,number'
        ),
    );
}